/*
 * EDAS2 - TetraTech, Inc.
 *
 * Distributable under GPL license.
 * See terms of license at gnu.org.
 */
package com.tetratech.edas2.model;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import org.hibernate.annotations.Type;
import org.hibernate.validator.Length;
import org.hibernate.validator.NotNull;

/**
 * ActivityType generated by hbm2java
 */
@Entity
@Table(name = "ED_ACTIVITY_TYPE")
public class ActivityType extends AttributableUpdateRetireEntity
		implements
			java.io.Serializable {

	private Long uid;
	private String code;
	private String description;
	private Boolean analyticalMethodRequired;
	private Boolean monitoringLocationRequired;
	private Set<Activity> activities = new HashSet<Activity>(0);

	public ActivityType() {
	}

	public ActivityType(Long uid, String code,
			Boolean analyticalMethodRequired, Boolean monitoringLocationRequired) {
		this.uid = uid;
		this.code = code;
		this.analyticalMethodRequired = analyticalMethodRequired;
		this.monitoringLocationRequired = monitoringLocationRequired;
	}

	@Id
	@Column(name = "ACTYP_UID", unique = true, nullable = false, precision = 6, scale = 0)
	@NotNull
	public Long getUid() {
		return this.uid;
	}

	public void setUid(Long uid) {
		this.uid = uid;
	}

	@Column(name = "ACTYP_CD", nullable = false, length = 70)
	@NotNull
	@Length(max = 70)
	public String getCode() {
		return this.code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	@Column(name = "ACTYP_DESC", length = 400)
	@Length(max = 400)
	public String getDescription() {
		return this.description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	@Column(name = "ACTYP_ANL_MTH_REQ_YN", nullable = false, length = 1)
	@Type(type = "yes_no")
	@NotNull
	public Boolean getAnalyticalMethodRequired() {
		return this.analyticalMethodRequired;
	}

	public void setAnalyticalMethodRequired(Boolean analyticalMethodRequired) {
		this.analyticalMethodRequired = analyticalMethodRequired;
	}

	@Column(name = "ACTYP_MON_LOC_REQ_YN", nullable = false, length = 1)
	@Type(type = "yes_no")
	@NotNull
	public Boolean getMonitoringLocationRequired() {
		return this.monitoringLocationRequired;
	}

	public void setMonitoringLocationRequired(Boolean monitoringLocationRequired) {
		this.monitoringLocationRequired = monitoringLocationRequired;
	}
	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "type")
	public Set<Activity> getActivities() {
		return this.activities;
	}

	public void setActivities(Set<Activity> activities) {
		this.activities = activities;
	}

}
